<?php
/**
 * 货品Logic
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2017/12/29
 * Time: 18:21
 */

namespace App\Http\Logics\Admin;

use App\Http\Logics\BaseLogic;
use App\Product;

class ProductLogic extends BaseLogic
{
    public static function getProductList($data)
    {
        $query = Product::with(['user']);
        $product = $data['limit'] ? $query->paginate($data['limit']) : $query->get();
        if (empty($product)){
            return self::response(self::CONTENT_IS_EMPTY);
        }
        return self::response(self::SUCCESS, $product);
    }
}